package com.cheetah.start.common.utils;

import cn.dev33.satoken.secure.BCrypt;

public class PasswordUtil {

    /**
     *
     *
     * @param password 密码
     * @return {@link String}
     */
    public static String hashPassword(String password) {
        return BCrypt.hashpw(password);
    }

    /**
     *
     *
     * @param hashPassword 哈希密码
     * @param password     密码
     * @return boolean
     */
    public static boolean validPassword(String hashPassword, String password) {
        return BCrypt.checkpw(password, hashPassword);
    }
}
